
<template>
    <div class="exempt-penalty-interest-form">
        <Form ref="formValidate" :model="formValidate" :label-width="100" :rules="ruleInline">
            <Row>
                <Col span="24">
                    <Row>
                        <Col :xs="24" :sm="12" :md="12" :lg="8" :xl="8" :xxl="8">
                            <FormItem label="编号" prop="batchNo">
                                <Input v-model="formValidate.batchNo" placeholder clearable />
                            </FormItem>
                        </Col>
                        <Col :xs="24" :sm="12" :md="12" :lg="8" :xl="8" :xxl="8">
                            <FormItem label="当前应还款日" prop="dueDate">
                                <DatePicker
                                    format="yyyy-MM-dd"
                                    placeholder="请选择"
                                    :transfer="true"
                                    v-model="formValidate.dueDate"
                                    separator=" 至 "
                                    type="daterange"
                                ></DatePicker>
                            </FormItem>
                        </Col>
                        <Col :xs="24" :sm="12" :md="12" :lg="8" :xl="8" :xxl="8">
                            <FormItem label="申请编号" prop="applyNo">
                                <Input v-model="formValidate.applyNo" placeholder clearable />
                            </FormItem>
                        </Col>
                        <Col :xs="24" :sm="12" :md="12" :lg="8" :xl="8" :xxl="8">
                            <FormItem label="合同号" prop="contractNo">
                                <Input v-model="formValidate.contractNo" placeholder clearable />
                            </FormItem>
                        </Col>
                        <!-- 无字段  -->
                        <Col :xs="24" :sm="12" :md="12" :lg="8" :xl="8" :xxl="8">
                            <FormItem label="金融产品" prop="custName">
                                <Input v-model="formValidate.custName" placeholder clearable />
                            </FormItem>
                        </Col>

                        <Col :xs="24" :sm="12" :md="12" :lg="8" :xl="8" :xxl="8">
                            <FormItem label="区域" prop="region">
                                <Select
                                    v-model="formValidate.region"
                                    placeholder="请选择"
                                    clearable
                                    multiple
                                >
                                    <Option
                                        v-for="(item,index) in processStatusDict"
                                        :key="index"
                                        :value="item.value"
                                    >{{item.title}}</Option>
                                </Select>
                            </FormItem>
                        </Col>
                        <!-- 无字段  -->
                        <Col :xs="24" :sm="12" :md="12" :lg="8" :xl="8" :xxl="8">
                            <FormItem label="省份" prop="contractStatus">
                                <Select v-model="formValidate.contractStatus" clearable>
                                    <Option
                                        v-for="(item,index) in contractStatusDict"
                                        :key="index"
                                        :value="item.value"
                                    >{{item.title}}</Option>
                                </Select>
                            </FormItem>
                        </Col>
                        <Col :xs="24" :sm="12" :md="12" :lg="8" :xl="8" :xxl="8">
                            <FormItem label="城市" prop="city">
                                <Select v-model="formValidate.city" clearable>
                                    <Option
                                        v-for="(item,index) in contractStatusDict"
                                        :key="index"
                                        :value="item.value"
                                    >{{item.title}}</Option>
                                </Select>
                            </FormItem>
                        </Col>
                        <!--  processModeDict 未处理   newCar, oldCar -->
                        <Col :xs="24" :sm="12" :md="12" :lg="8" :xl="8" :xxl="8">
                            <FormItem label="业务类型" prop="businessType">
                                <Select v-model="formValidate.businessType" multiple clearable>
                                    <Option
                                        v-for="(item,index) in processModeDict"
                                        :key="index"
                                        :value="item.value"
                                    >{{item.title}}</Option>
                                </Select>
                            </FormItem>
                        </Col>
                        <!-- <Col :xs="24" :sm="12" :md="12" :lg="8" :xl="8" :xxl="8">
                            <FormItem label="费用类型" prop="costType">
                                <Select v-model="formValidate.costType" multiple clearable>
                                    <Option
                                        v-for="(item,index) in processModeDict"
                                        :key="index"
                                        :value="item.value"
                                    >{{item.title}}</Option>
                                </Select>
                            </FormItem>
                        </Col>-->
                    </Row>
                </Col>

                <Col span="24">
                    <div class="contract-btns">
                        <Button
                            type="primary"
                            @click="handleSubmit('formValidate')"
                            style="margin-right:16px"
                        >查询</Button>
                        <Button type="primary" @click="handleReset('formValidate')">重置</Button>
                    </div>
                </Col>
            </Row>
        </Form>
    </div>
</template>
<script>

    export default {
    name: "interestForm",
    props: {
        formValidate: {
            type: Object,
            required: true
        },
        processStatusDict: {
            type: Array,
            required: true
        },
        contractStatusDict: {
            type: Array,
            required: true
        },
        processModeDict: {
            type: Array,
            required: true
        }
    },
    data() {
        return {
            loading: false,
            // 日期区间
            isDateErr: false,

            ruleInline: {
                // endTime: [{ validator: validateEndDate, trigger: "change" }],
                // createTime: [
                //     { validator: validateStartDate, trigger: "change" }
                // ]
            },
            data: {
                // applyNo	string
                // 申请编号

                // batchNo	string
                // 编号

                // businessType	string
                // 业务类型
                // Enum:
                // [ newCar, oldCar ]

                // city	string
                // 城市

                // contractNo	string
                // 合同号

                // costType	string
                // 费用类型

                // custName	string
                // 客户姓名

                // dataSource	string
                // 数据来源 枚举值：CMS、多品系统
                // Enum:
                // Array [ 2 ]

                // dueDate	string($date-time)
                // 当前应还款日

                // endDate	string($date-time)
                // 结束计算日期

                // exemptedAmt	number
                // 已豁免金额

                // exemptionAmt	number
                // 本次豁免金额

                // netAmt	number
                // 净逾期额

                // overdueDays	integer($int32)
                // 逾期天数

                // pageNumber	integer($int32)
                // 当前页

                // pageSize	integer($int32)
                // 多少条

                // payableAmt	number
                // 应还款金额

                // productId	string
                // 产品Id

                // receivableRent	number
                // 租金

                // receivedAmt	number
                // 已收款金额（核销额）

                // region	string
                // 区域

                // startDate	string($date-time)
                // 开始计算日期

                // termNo	integer($int32)
                // 期数

                // totalPenalty	number
                // 罚息总额
            }
        };
    },
    mounted() {
        this.init();
    },
    methods: {
        init() {},
        // 查询
        handleSubmit(name) {
            this.$refs[name].validate(valid => {
                if (valid) {
                    this.loading = true;
                    console.log(this.formValidate,'this.formValidate')
                    this.$emit("getList", this.formValidate);
                }
            });
        },
        handleReset(name) {
            this.$refs[name].resetFields();
            this.handleSubmit(name)
        },

    },
    computed: {}
};
</script>
<style scoped>
.contract-btns {
    text-align: center;
}
</style>
